package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HeartRateSensorMapper;
import com.ruoyi.system.domain.HeartRateSensor;
import com.ruoyi.system.service.IHeartRateSensorService;

/**
 * 心率传感器数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-28
 */
@Service
public class HeartRateSensorServiceImpl implements IHeartRateSensorService 
{
    @Autowired
    private HeartRateSensorMapper heartRateSensorMapper;

    /**
     * 查询心率传感器数据
     * 
     * @param id 心率传感器数据主键
     * @return 心率传感器数据
     */
    @Override
    public HeartRateSensor selectHeartRateSensorById(Long id)
    {
        return heartRateSensorMapper.selectHeartRateSensorById(id);
    }

    /**
     * 查询心率传感器数据列表
     * 
     * @param heartRateSensor 心率传感器数据
     * @return 心率传感器数据
     */
    @Override
    public List<HeartRateSensor> selectHeartRateSensorList(HeartRateSensor heartRateSensor)
    {
        return heartRateSensorMapper.selectHeartRateSensorList(heartRateSensor);
    }

    /**
     * 新增心率传感器数据
     * 
     * @param heartRateSensor 心率传感器数据
     * @return 结果
     */
    @Override
    public int insertHeartRateSensor(HeartRateSensor heartRateSensor)
    {
        heartRateSensor.setCreateTime(DateUtils.getNowDate());
        return heartRateSensorMapper.insertHeartRateSensor(heartRateSensor);
    }

    /**
     * 修改心率传感器数据
     * 
     * @param heartRateSensor 心率传感器数据
     * @return 结果
     */
    @Override
    public int updateHeartRateSensor(HeartRateSensor heartRateSensor)
    {
        return heartRateSensorMapper.updateHeartRateSensor(heartRateSensor);
    }

    /**
     * 批量删除心率传感器数据
     * 
     * @param ids 需要删除的心率传感器数据主键
     * @return 结果
     */
    @Override
    public int deleteHeartRateSensorByIds(Long[] ids)
    {
        return heartRateSensorMapper.deleteHeartRateSensorByIds(ids);
    }

    /**
     * 删除心率传感器数据信息
     * 
     * @param id 心率传感器数据主键
     * @return 结果
     */
    @Override
    public int deleteHeartRateSensorById(Long id)
    {
        return heartRateSensorMapper.deleteHeartRateSensorById(id);
    }
}
